<!doctype html>


<html>
<head>
  <link rel="shortcut icon" href="static/images/favicon.ico" type="image/x-icon">
  <title>MockClassFactory (Closure Library API Documentation - JavaScript)</title>
  <link rel="stylesheet" href="static/css/base.css">
  <link rel="stylesheet" href="static/css/doc.css">
  <link rel="stylesheet" href="static/css/sidetree.css">
  <link rel="stylesheet" href="static/css/prettify.css">

  <script>
     var _staticFilePath = "static/";
     var _typeTreeName = "goog";
     var _fileTreeName = "Source";
  </script>

  <script src="static/js/doc.js">
  </script>

  <script type="text/javascript" src="//www.google.com/jsapi"></script>
  <script type="text/javascript">
     google.load("visualization", "1", {packages:["orgchart"]});
     var _loadingVisualizations = true;
  </script>

  <meta charset="utf8">
</head>

<body onload="grokdoc.onLoad();">

<div id="header">
  <div class="g-section g-tpl-50-50 g-split">
    <div class="g-unit g-first">
      <a id="logo" href="index.html">Closure Library API Documentation</a>
    </div>

    <div class="g-unit">
      <div class="g-c">
        <strong>Go to class or file:</strong>
        <input type="text" id="ac">
      </div>
    </div>
  </div>
</div>





<div class="colmask rightmenu">
<div class="colleft">
    <div class="col1">
      <!-- Column 1 start -->

<div id="title">
        <span class="fn">testing.MockClassFactory</span>
        <span>Extends</span>
        <span class="fn-name">
          
        </span>
</div>

<div class="g-section g-tpl-75-25">
  <div class="g-unit g-first" id="description">
    A factory used to create new mock class instances.  It is able to generate
both static and loose mocks.  The MockClassFactory is a singleton since it
tracks the classes that have been mocked internally.

  </div>


        <div class="g-unit" id="useful-links">
          <div class="title">Useful links</div>
          <ol>
            <li><a href="local_closure_goog_testing_mockclassfactory.js.source.html"><span class='source-code-link'>Source Code</span></a></li>
            <li><a href="http://code.google.com/p/closure-library/source/browse/local/closure/goog/testing/mockclassfactory.js">Git</a></li>
          </ol>
        </div>
</div>






<h2 class="g-first">Inheritance</h2>
<div class='gviz-org-chart-container goog-inline-block'>
<table class='gviz-org-chart' style='display:none'>
  <tr><td>goog.testing.MockClassFactory</td><td></td></tr>
</table>
</div>
<div class='gviz-org-chart-container goog-inline-block'>
<table class='gviz-org-chart' style='display:none'>
</table>
</div>




  <h2>Constructor</h2>
      <div class="fn-constructor">
    goog.testing.MockClassFactory(<span></span>)
  </div>



<h2>Instance Methods</h2>


  <div class="legend">
        <span class="key publickey"></span><span>Public</span>
        <span class="key protectedkey"></span><span>Protected</span>
        <span class="key privatekey"></span><span>Private</span>
  </div>







<div>
       <div class="desc">
         Defined in
         <span class="fn-name">
            <a href="class_goog_testing_MockClassFactory.html">
              goog.testing.MockClassFactory
            </a>
         </span>
       </div>






<div class="section">
  <table class="horiz-rule">


     <tr class="even entry private">
       <td class="access"></td>






  <td>
    <a name="goog.testing.MockClassFactory.prototype.classHasMock_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">classHasMock_<span class="args">(<span class="arg">className</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>
      </div>


     <div class="entryOverview">
       Returns whether or not a given class has been mocked.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">className</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
        <div class="entryOverview">The name of the class.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>&nbsp;
            Whether or not the given class name has a MockClassRecord.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_testing_mockclassfactory.js.source.html#line286">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>






  <td>
    <a name="goog.testing.MockClassFactory.prototype.createProxy_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">createProxy_<span class="args">(<span class="arg">namespace</span>,&nbsp;<span class="arg">classToMock</span>,&nbsp;<span class="arg">className</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Function">Function</a></span>
      </div>


     <div class="entryOverview">
       Create a proxy class.  A proxy will pass functions to the mock for a class.
The proxy class only covers prototype methods.  A static mock is not build
simultaneously since it might be strict or loose.  The proxy class inherits
from the target class in order to preserve instanceof checks.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">namespace</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object">Object</a></span>
        <div class="entryOverview">A javascript namespace (e.g. goog.testing).</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">classToMock</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Function">Function</a></span>
        <div class="entryOverview">The class that will be proxied.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">className</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
        <div class="entryOverview">The name of the class.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Function">Function</a></span>&nbsp;
            The proxy for provided class.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_testing_mockclassfactory.js.source.html#line355">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry private">
       <td class="access"></td>






  <td>
    <a name="goog.testing.MockClassFactory.prototype.createStaticMock_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">createStaticMock_<span class="args">(<span class="arg">classToMock</span>,&nbsp;<span class="arg">className</span>,&nbsp;<span class="arg">proxy</span>,&nbsp;<span class="arg">isStrict</span>)</span>
        </span>
        &#8658; <span>!</span><span class="type"><a href="class_goog_testing_StrictMock.html">goog.testing.StrictMock</a></span><span>&nbsp;|&nbsp;</span><span>!</span><span class="type"><a href="class_goog_testing_LooseMock.html">goog.testing.LooseMock</a></span>
      </div>


     <div class="entryOverview">
       Creates either a loose or strict mock for the static functions of a given
class.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">classToMock</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Function">Function</a></span>
        <div class="entryOverview">The class whose static functions will be
    mocked.  This should be the original class and not the proxy.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">className</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
        <div class="entryOverview">The name of the class.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">proxy</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Function">Function</a></span>
        <div class="entryOverview">The proxy that will replace the original class.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">isStrict</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>
        <div class="entryOverview">Whether or not the mock should be strict.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type"><a href="class_goog_testing_StrictMock.html">goog.testing.StrictMock</a></span><span>&nbsp;|&nbsp;</span><span>!</span><span class="type"><a href="class_goog_testing_LooseMock.html">goog.testing.LooseMock</a></span>&nbsp;
            The mock created
    for the static functions of the provided class.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_testing_mockclassfactory.js.source.html#line474">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>






  <td>
    <a name="goog.testing.MockClassFactory.prototype.findMockInstance_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">findMockInstance_<span class="args">(<span class="arg">className</span>,&nbsp;<span class="arg">args</span>)</span>
        </span>
        &#8658; <span class="type"><a href="class_goog_testing_StrictMock.html">goog.testing.StrictMock</a></span><span>&nbsp;|&nbsp;</span><span class="type"><a href="class_goog_testing_LooseMock.html">goog.testing.LooseMock</a></span>
      </div>


     <div class="entryOverview">
       Find a mock instance for a given class name and argument list.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">className</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
        <div class="entryOverview">The name of the class.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">args</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>
        <div class="entryOverview">The argument list to match.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="class_goog_testing_StrictMock.html">goog.testing.StrictMock</a></span><span>&nbsp;|&nbsp;</span><span class="type"><a href="class_goog_testing_LooseMock.html">goog.testing.LooseMock</a></span>&nbsp;
            The mock found for
    the given argument list.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_testing_mockclassfactory.js.source.html#line338">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry private">
       <td class="access"></td>






  <td>
    <a name="goog.testing.MockClassFactory.prototype.getClassName_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">getClassName_<span class="args">(<span class="arg">namespace</span>,&nbsp;<span class="arg">classToMock</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
      </div>


     <div class="entryOverview">
       Iterates through a namespace to find the name of a given class.  This is done
solely to support compilation since string identifiers would break down.
Tests usually aren't compiled, but the functionality is supported.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">namespace</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object">Object</a></span>
        <div class="entryOverview">A javascript namespace (e.g. goog.testing).</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">classToMock</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Function">Function</a></span>
        <div class="entryOverview">The class whose name should be returned.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>&nbsp;
            The name of the class.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_testing_mockclassfactory.js.source.html#line265">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.testing.MockClassFactory.prototype.getLooseMockClass"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">getLooseMockClass<span class="args">(<span class="arg">namespace</span>,&nbsp;<span class="arg">classToMock</span>,&nbsp;<span class="arg">var_args</span>)</span>
        </span>
        &#8658; <span class="type"><a href="class_goog_testing_LooseMock.html">goog.testing.LooseMock</a></span>
      </div>


     <div class="entryOverview">
       Gets a loose mock for a given class.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">namespace</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object">Object</a></span>
        <div class="entryOverview">A javascript namespace (e.g. goog.testing).</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">classToMock</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Function">Function</a></span>
        <div class="entryOverview">The class that will be mocked.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">var_args</span>
        : <span class="type">...*</span>
        <div class="entryOverview">The arguments associated with this instance's
    constructor.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="class_goog_testing_LooseMock.html">goog.testing.LooseMock</a></span>&nbsp;
            The mock created for the provided class.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_testing_mockclassfactory.js.source.html#line455">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.testing.MockClassFactory.prototype.getLooseStaticMock"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">getLooseStaticMock<span class="args">(<span class="arg">namespace</span>,&nbsp;<span class="arg">classToMock</span>)</span>
        </span>
        &#8658; <span class="type"><a href="class_goog_testing_LooseMock.html">goog.testing.LooseMock</a></span>
      </div>


     <div class="entryOverview">
       Gets a loose mock for the static functions of a given class.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">namespace</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object">Object</a></span>
        <div class="entryOverview">A javascript namespace (e.g. goog.testing).</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">classToMock</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Function">Function</a></span>
        <div class="entryOverview">The class whose static functions will be
    mocked.  This should be the original class and not the proxy.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="class_goog_testing_LooseMock.html">goog.testing.LooseMock</a></span>&nbsp;
            The mock created for the static functions
    of the provided class.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_testing_mockclassfactory.js.source.html#line564">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>






  <td>
    <a name="goog.testing.MockClassFactory.prototype.getMockClass_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">getMockClass_<span class="args">(<span class="arg">namespace</span>,&nbsp;<span class="arg">classToMock</span>,&nbsp;<span class="arg">isStrict</span>,&nbsp;<span class="arg">ctorArgs</span>)</span>
        </span>
        &#8658; <span>!</span><span class="type"><a href="class_goog_testing_StrictMock.html">goog.testing.StrictMock</a></span><span>&nbsp;|&nbsp;</span><span>!</span><span class="type"><a href="class_goog_testing_LooseMock.html">goog.testing.LooseMock</a></span>
      </div>


     <div class="entryOverview">
       Gets either a loose or strict mock for a given class based on a set of
arguments.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">namespace</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object">Object</a></span>
        <div class="entryOverview">A javascript namespace (e.g. goog.testing).</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">classToMock</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Function">Function</a></span>
        <div class="entryOverview">The class that will be mocked.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">isStrict</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>
        <div class="entryOverview">Whether or not the mock should be strict.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">ctorArgs</span>
        : <span class="type">goog.array.ArrayLike</span>
        <div class="entryOverview">The arguments associated with this
    instance's constructor.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type"><a href="class_goog_testing_StrictMock.html">goog.testing.StrictMock</a></span><span>&nbsp;|&nbsp;</span><span>!</span><span class="type"><a href="class_goog_testing_LooseMock.html">goog.testing.LooseMock</a></span>&nbsp;
            The mock created
    for the provided class.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_testing_mockclassfactory.js.source.html#line401">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry private">
       <td class="access"></td>






  <td>
    <a name="goog.testing.MockClassFactory.prototype.getProxyCtor_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">getProxyCtor_<span class="args">(<span class="arg">className</span>,&nbsp;<span class="arg">mockFinder</span>)</span>
        </span>
        &#8658; <span>!</span><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Function">Function</a></span>
      </div>


     <div class="entryOverview">
       Returns a proxy constructor closure.  Since this is a constructor, "this"
refers to the local scope of the constructed object thus bind cannot be
used.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">className</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
        <div class="entryOverview">The name of the class.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">mockFinder</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Function">Function</a></span>
        <div class="entryOverview">A bound function that returns the mock
    associated with a class given the constructor's argument list.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Function">Function</a></span>&nbsp;
            A proxy constructor.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_testing_mockclassfactory.js.source.html#line301">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>






  <td>
    <a name="goog.testing.MockClassFactory.prototype.getProxyFunction_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">getProxyFunction_<span class="args">(<span class="arg">fnName</span>)</span>
        </span>
        &#8658; <span>!</span><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Function">Function</a></span>
      </div>


     <div class="entryOverview">
       Returns a proxy function for a mock class instance.  This function cannot
be used with bind since "this" must refer to the scope of the proxy
constructor.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">fnName</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
        <div class="entryOverview">The name of the function that should be proxied.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Function">Function</a></span>&nbsp;
            A proxy function.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_testing_mockclassfactory.js.source.html#line323">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry private">
       <td class="access"></td>






  <td>
    <a name="goog.testing.MockClassFactory.prototype.getStaticMock_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">getStaticMock_<span class="args">(<span class="arg">namespace</span>,&nbsp;<span class="arg">classToMock</span>,&nbsp;<span class="arg">isStrict</span>)</span>
        </span>
        &#8658; <span class="type"><a href="class_goog_testing_StrictMock.html">goog.testing.StrictMock</a></span><span>&nbsp;|&nbsp;</span><span class="type"><a href="class_goog_testing_LooseMock.html">goog.testing.LooseMock</a></span>
      </div>


     <div class="entryOverview">
       Gets either a loose or strict mock for the static functions of a given class.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">namespace</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object">Object</a></span>
        <div class="entryOverview">A javascript namespace (e.g. goog.testing).</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">classToMock</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Function">Function</a></span>
        <div class="entryOverview">The class whose static functions will be
    mocked.  This should be the original class and not the proxy.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">isStrict</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>
        <div class="entryOverview">Whether or not the mock should be strict.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="class_goog_testing_StrictMock.html">goog.testing.StrictMock</a></span><span>&nbsp;|&nbsp;</span><span class="type"><a href="class_goog_testing_LooseMock.html">goog.testing.LooseMock</a></span>&nbsp;
            The mock created
    for the static functions of the provided class.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_testing_mockclassfactory.js.source.html#line502">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.testing.MockClassFactory.prototype.getStrictMockClass"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">getStrictMockClass<span class="args">(<span class="arg">namespace</span>,&nbsp;<span class="arg">classToMock</span>,&nbsp;<span class="arg">var_args</span>)</span>
        </span>
        &#8658; <span class="type"><a href="class_goog_testing_StrictMock.html">goog.testing.StrictMock</a></span>
      </div>


     <div class="entryOverview">
       Gets a strict mock for a given class.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">namespace</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object">Object</a></span>
        <div class="entryOverview">A javascript namespace (e.g. goog.testing).</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">classToMock</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Function">Function</a></span>
        <div class="entryOverview">The class that will be mocked.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">var_args</span>
        : <span class="type">...*</span>
        <div class="entryOverview">The arguments associated with this instance's
    constructor.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="class_goog_testing_StrictMock.html">goog.testing.StrictMock</a></span>&nbsp;
            The mock created for the provided class.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_testing_mockclassfactory.js.source.html#line440">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.testing.MockClassFactory.prototype.getStrictStaticMock"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">getStrictStaticMock<span class="args">(<span class="arg">namespace</span>,&nbsp;<span class="arg">classToMock</span>)</span>
        </span>
        &#8658; <span class="type"><a href="class_goog_testing_StrictMock.html">goog.testing.StrictMock</a></span>
      </div>


     <div class="entryOverview">
       Gets a strict mock for the static functions of a given class.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">namespace</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object">Object</a></span>
        <div class="entryOverview">A javascript namespace (e.g. goog.testing).</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">classToMock</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Function">Function</a></span>
        <div class="entryOverview">The class whose static functions will be
    mocked.  This should be the original class and not the proxy.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="class_goog_testing_StrictMock.html">goog.testing.StrictMock</a></span>&nbsp;
            The mock created for the static functions
    of the provided class.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_testing_mockclassfactory.js.source.html#line549">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.testing.MockClassFactory.prototype.reset"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">reset<span class="args">()</span>
        </span>
      </div>


     <div class="entryOverview">
       Resests the factory by reverting all mocked classes to their original
implementations and removing all MockClassRecords.

     </div>

   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_testing_mockclassfactory.js.source.html#line575">code &raquo;</a>
  </td>
     </tr>


  </table>
</div>
</div>




<h2>Instance Properties</h2>







<div>
       <div class="desc">
         Defined in
         <span class="fn-name">
            <a href="class_goog_testing_MockClassFactory.html">
              goog.testing.MockClassFactory
            </a>
         </span>
       </div>






<div class="section">
  <table class="horiz-rule">


     <tr class="even entry private">
       <td class="access"></td>





  <a name="goog.testing.MockClassFactory.prototype.mockClassRecords_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">mockClassRecords_</span>
        : 
     </div>


     <div class="entryOverview">
       A map from class name -&gt; goog.testing.MockClassRecord.

     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_testing_mockclassfactory.js.source.html#line226">Code &raquo;</a>
  </td>
     </tr>


  </table>
</div>
</div>










<div class="section">
  <table class="horiz-rule">


  </table>
</div>



<h2>Static Properties</h2>






<div class="section">
  <table class="horiz-rule">


     <tr class="even entry private">
       <td class="access"></td>





  <a name="goog.testing.MockClassFactory.PROTOTYPE_FIELDS_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.testing.MockClassFactory.</span><span class="entryName">PROTOTYPE_FIELDS_</span>
        : 
     </div>


     <div class="entryOverview">
       The names of the fields that are defined on Object.prototype.

     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_testing_mockclassfactory.js.source.html#line245">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>





  <a name="goog.testing.MockClassFactory.instance_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.testing.MockClassFactory.</span><span class="entryName">instance_</span>
        : <span class="type"><a href="class_goog_testing_MockClassFactory.html">goog.testing.MockClassFactory</a></span>
     </div>


     <div class="entryOverview">
       A singleton instance of the MockClassFactory.

     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_testing_mockclassfactory.js.source.html#line237">Code &raquo;</a>
  </td>
     </tr>


  </table>
</div>









<div class="section">
  <table class="horiz-rule">


  </table>
</div>
      <!-- Column 1 end -->
    </div>

        <div class="col2">
          <!-- Column 2 start -->
          <div class="col2-c">
            <h2 id="ref-head">Package testing</h2>
            <div id="localView"></div>
          </div>

          <div class="col2-c">
            <h2 id="ref-head">Package Reference</h2>
            <div id="sideTypeIndex" rootPath="" current="testing.MockClassFactory"></div>
          </div>
          <!-- Column 2 end -->
        </div>
</div>
</div>

</body>
</html>
